package com.oracle.common;

import lombok.*;

@ToString
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
@Data
public class R<T> {

    private int code;   //响应状态码
    private String msg;   //响应状态码
    private T data;

    public static<T> R success(T data){
        return new R(StatusEnums.successEnum.getCode(),StatusEnums.successEnum.getMsg(), data);
    }

    public static<T> R failed(T data){
        return new R(StatusEnums.failedEnum.getCode(), StatusEnums.failedEnum.getMsg(), data);
    }

}
